package com.ht.videorecode.fxbase;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.awt.*;

/**
 * @author 王瑞
 * @description: TODO
 * @date 2021/1/13  16:52
 */
@Component
@Data
@ConfigurationProperties(prefix="video.recorder")
public class RecorderUtil {

    private int startx,starty,width,height;
    private String fileName;


   public VideoRecorder getVideoRecorderInstance(String videoName){
       Rectangle rectangle = new Rectangle(startx,starty,width, height); // 截屏的大小
       String  fileHoldName = fileName + videoName;
       //调用录屏API
       VideoRecorder videoRecord  = new VideoRecorder(fileHoldName, true,rectangle);
       return videoRecord;
   }

}
